/* 导入路由规则 */
import type {RouteRecordRaw} from "vue-router";

/* 定义路由配置并暴露 */
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path:'/login',
    name:'login',
    component:()=> import('../components/Login/index.vue'),
    meta:{
      isHidden:true
    }
  },
  {
    path:'/404',
    name:'404',
    component:()=> import('../components/404/index.vue'),
    meta:{
      isHidden:true
    }
  },
  {
    path:'/',
    redirect:'/home'
  },
  {
    path:'/home',
    name:'home',
    component:()=> import('../pages/home/index.vue')
  },
  {
    path:'/category',
    name:'category',
    component:()=> import('../pages/category/index.vue'),
  },
  {
    path:'/goodslist',
    name:'goodsList',
    component:()=> import('../pages/category/goodsList.vue'),
    meta:{
      isHidden:true
    }
  },
  {
    path: '/detail',
    name:'detail',
    component: ()=>import('../pages/category/detail.vue'),
    meta:{
      isHidden:true
    }
  },
  {
    path: "/recommend",
    name: "recommend",
    component: () => import("../pages/recommend/index.vue"),
  },
  {
    path: "/shopcart",
    name: "shopcart",
    component: () => import("../pages/shopcart/index.vue"),
  },
  {
    path: "/pay",
    name: "pay",
    component: () => import("../pages/pay/index.vue"),
    meta:{
      isHidden:true
    }
  },
  {
    path:'/pay_success',
    name:"paySuccess",
    component: () => import("../pages/pay/paySuccess.vue"),
    meta:{
      // isHidden:true
    }
  },
  {
    path:'/order_success',
    name:"oderSuccess",
    component: () => import("../pages/pay/oderSuccess.vue"),
    meta:{
      // isHidden:true
    }
  },
  {
    path: "/center",
    name: "center",
    component: () => import("../pages/center/index.vue"),
  },
  {
    path:'/phone',
    name:'phone',
    component:()=> import('../components/Login/phone/index.vue'),
    meta:{
      isHidden:true
    }
  },
  {
    path:'/email',
    name:'email',
    component:()=> import('../components/Login/email/index.vue'),
    meta:{
      isHidden:true
    }
  },
  {
    path:'/myorder',
    name:'myOrder',
    component:()=> import('../pages/center/myOrder/index.vue'),
    meta:{
      isHidden:true
    }
  },
  {
    path:'/register',
    name:'register',
    component:()=> import('../components/Login/register/index.vue'),
    meta:{
      isHidden:true
    }
  },
  {
    path:'/search',
    name:'search',
    component:()=> import('../components/Search/index.vue'),
    meta:{
      isHidden:true
    }
  },
  {
    path:'/searchzyt',
    name:'searchzyt',
    component:()=>import('../components/Search/pages/index.vue')
  }
]

export const anyRoutes: Array<RouteRecordRaw> = [
  {
    path: '/:pathMatch(.*)*',
    redirect:'/404'
  }
]